package com.kingsoft.dc.khaos.module.spark.metadata.preprocess.specific.quality

import org.json4s.JsonAST.JObject


/**
  * 封装业务检核json模板传递参数
  *
  * @author liuyg
  * @date 2019/7/28 15:14
  *
  */
case class BussinessCheckInfo(db_name: String = null,
                              sub_table:Option[SubTable],
                          table_name: String = null,
                          extender: ExtenderInfo = null,
                          test_run: Option[Boolean],
                          relation_table: Option[String],
                          limit: Option[Int],
                          extract_fields: List[ColOption] = List()) {
}

case class Extender(check: ExtenderCheck = null) {

}

case class SubTable(on_off: String = null,
                    suffix: String = null) {

}

case class ExtenderCheck(clazz: String = null,
                  params: JObject = null) {
}

case class BussinessParams(ds_id: Integer = null,
                  ds_type: String = null,
                  ds_name: String = null,
                  project_id: Integer = null,
                  rule_ids: List[String] = List()) {
}

case class ColOption(field: String = null,
                     data_type: String = null,
                     length: Option[String] = null,
                     option: BussinessOption = null) {
}

case class BussinessOption(business_check: BusinessCheck = null) {

}

case class BusinessCheck(on_off: Boolean = false,
                         rule_options: List[RuleConfigure] = List()) {

}

case class RuleConfigure(rule_id: String = null,
                         rule_name: String = null,
                         rule_type: String = null) {

}
